/**
 * 
 */
package com.csc.bankingsystem.core.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.csc.bankingsystem.core.dao.AccountInfoDAO;
import com.csc.bankingsystem.core.entity.AccountInfo;
import com.csc.bankingsystem.core.service.AccountInfoService;


/**
 * Implement all service operation of AccountInfoService
 * @author angelkid
 *
 */
@Service("accountInfoService")
@Transactional
public class AccountInfoServiceImpl implements AccountInfoService {
	@Autowired
	AccountInfoDAO accountInfoDAO;

	public AccountInfo find(long id) {
		return accountInfoDAO.find(id);
	}

	public List<AccountInfo> findAll() {
		return accountInfoDAO.findAll();
	}

	public Long countAll() {
		return accountInfoDAO.countAll();
	}

	public Long save(AccountInfo accountInfo){
		return accountInfoDAO.save(accountInfo);
	}

	public void update(AccountInfo accountInfo){
		accountInfoDAO.update(accountInfo);
	}

	public void delete(AccountInfo accountInfo) {
		accountInfoDAO.delete(accountInfo);
	}

	public List<AccountInfo> findAllByUserInfoId(long id) {
		return accountInfoDAO.findAllByUserInfoId(id);
	}

	public AccountInfo findByAccountNumber(String number) {
		return accountInfoDAO.findByAccountNumber(number);
	}
}
